<!DOCTYPE html>
<html lang="zh">
<head>
    <title><{:isset($webConf.bs_title)?$webConf.bs_title:'BS后台管理'}></title>
    <{include file="public/header"}>
    <{include file="public/data_tables_css"}>
    <link type="text/css" rel="stylesheet" href="/static/adminlte/plugins/jedate-6.5.0/skin/jedate.css">
    <script type="text/javascript" src="/static/adminlte/plugins/jedate-6.5.0/src/jedate.js"></script>
</head>
<body class="hold-transition sidebar-mini layout-fixed">
<!-- Site wrapper -->
<div class="wrapper">
    <!-- Navbar -->
    <{include file="public/navbar"}>
    <!-- /.navbar -->

    <!-- Main Sidebar Container -->
    <!--左侧菜单-->
    <{include file="public/sidebar"}>

    <!-- Content Wrapper. Contains page content -->
    <div class="content-wrapper">
        <!-- Content Header (Page header) -->
        <section class="content-header">
            <div class="container-fluid">
                <div class="row mb-2">
                    <div class="col-sm-6">
                        <h1>订单管理</h1>
                    </div>
                    <div class="col-sm-6">
                        <ol class="breadcrumb float-sm-right">
                            <li class="breadcrumb-item"><a href="<{:url('/admin/index/index')}>">首页</a></li>
                            <li class="breadcrumb-item"><a href="#">订单管理</a></li>
                            <li class="breadcrumb-item active">订单列表</li>
                        </ol>
                    </div>
                </div>
            </div><!-- /.container-fluid -->
        </section>

        <!-- Main content -->
        <section class="content">
            <div class="container-fluid">


                <div class="card">
                    <div class="card-header">
                        <form action="<{:url()}>">
                            <div class="form-row ">

                                <div class="col-auto">
                                    <select name="status" class="form-control " >
                                        <option  value="">全部状态</option>
                                        <option <{if null !== $Request.param.status &&$Request.param.status=='1'}>selected<{/if}>  value="1">待发货</option>
                                        <option <{if null !== $Request.param.status &&$Request.param.status=='0'}>selected<{/if}> value="0">待支付</option>
                                        <option <{if null !== $Request.param.status &&$Request.param.status=='2'}>selected<{/if}> value="2">待收货</option>
                                        <option <{if null !== $Request.param.status &&$Request.param.status=='3'}>selected<{/if}> value="3">已完成</option>
                                        <option <{if null !== $Request.param.status &&$Request.param.status=='-2'}>selected<{/if}> value="-2">已退款</option>
                                        <option <{if null !== $Request.param.status &&$Request.param.status=='-1'}>selected<{/if}> value="-1">已取消</option>
                                    </select>
                                </div>
                                <div class="col-auto">
                                    <select name="pay_type" class="form-control" >
                                        <option value="">付款方式</option>
                                        <option <{if null !== $Request.param.pay_type &&$Request.param.pay_type=='wechat'}>selected<{/if}>  value="wechat">微信</option>
                                        <option <{if null !== $Request.param.pay_type &&$Request.param.pay_type=='alipay'}>selected<{/if}>  value="alipay">支付宝</option>
                                        <option <{if null !== $Request.param.pay_type &&$Request.param.pay_type=='credit'}>selected<{/if}>  value="credit">余额</option>
                                    </select>
                                </div>
                                <div class="col-auto">
                                    <select name="orderType" class="form-control" >
                                        <option value="">订单类型</option>
                                        <option <{if null !== $Request.param.orderType &&$Request.param.pay_type=='0'}>selected<{/if}>  value="0">销售</option>
                                        <option <{if null !== $Request.param.orderType &&$Request.param.pay_type=='1'}>selected<{/if}>  value="1">展示</option>
                                        <option <{if null !== $Request.param.orderType &&$Request.param.pay_type=='2'}>selected<{/if}>  value="2">自提</option>
                                        <option <{if null !== $Request.param.orderType &&$Request.param.pay_type=='3'}>selected<{/if}>  value="3">虚拟商品</option>
                                    </select>
                                </div>
                                <div class="col-auto">

                                    <input name="keyword" type="text" class="form-control " placeholder="订单号搜索" value="">
                                </div>
                                <div class="col-auto">
                                    <div class="jeinpbox "><input autocomplete="off" type="text" class="jeinput form-control" id="time" placeholder="下单时间" name="time"></div>
                                </div>

                                <div class="col-auto">
                                    <button type="submit" class="btn btn-primary mb-2 "><i class="fas fa-search"></i></button>
                                    <a  href="<{:url('index')}>"  class="btn btn-default mb-2 bs-left-30" title="重置"><i class="fas fa-history"></i></a>

                                </div>
                            </div>
                        </form>
                    </div>
                    <!-- /.card-header -->
                    <div class="card-body">
                        <table id="my_table" class="table table-bordered table-striped">
                            <thead>
                            <tr>
                                <th>#</th>
                                <th>商品信息</th>
                                <th>下单用户</th>
                                <th>店铺</th>
                                <th>订单号</th>
                                <th>状态</th>
                                <th>订单类型</th>
                                <th>价格</th>
                                <th>支付方式</th>
                                <th>时间</th>
                                <th>操作</th>
                            </tr>
                            </thead>
                            <tbody>
                            <{if !empty($data)}>
                            <{foreach $data as $item}>
                            <tr>
                                <td><{$item.id}></td>
                                <td>
                                    <img src=" <{$item.goods.thumb}>" style="max-width: 50px" alt="">
                                    <span title="<{$item.goods.title}>"><{$item.goods.title}></span>
                                </td>
                                <td>
                                    <a href="<{:url('/admin/user.index/index',['keyword'=>$item.uid])}>"><{$item.user.account}></a>
                                </td>

                                <td>
                                    <{if !empty($item.store) }>
                                    <a href="<{:url(null,['store_num'=>$item.store_num])}>"><{$item.store.store_name}></a>

                                    <{else}>
                                   未知
                                    <{/if}>
                                  </td>
                                <td><{$item.order_sn}></td>
                                <td>
                                    <{$item.statusDesc}>
                                </td>
                                <td><{$item.typeDesc}></td>
                                <td>
                                    下单价格：￥<{$item.price}> <br>
                                    实付金额：￥<{$item.pay_price}> <br>
                                    优惠金额：￥<{$item.coupon_money}>
                                </td>
                                <td>
                                    <{$item.payType}>
                                </td>
                                <td>

                                    添加：<{$item.add_time|date="Y-m-d H:i:s",###}> <br>
                                    更新：<{$item.up_time|date="Y-m-d H:i:s",###}>

                                </td>
                                <td>

                                    <a href="<{:url('/admin/order.index/detail',['order_sn'=>$item.order_sn])}>" title="查看详情" class="btn btn-info btn-xs">查看详情</a>

                                    <{if !empty($item.refund)}>
                                    <a href="<{:url('/admin/order.index/detail',['order_sn'=>$item.order_sn])}>" title="处理售后" class="btn btn-danger btn-xs">售后处理</a>
                                    <{/if}>


                                </td>

                            </tr>
                            <{/foreach}>
                            <{/if}>



                            </tbody>
                            <tfoot>


                            </tfoot>
                        </table>
                    </div>
                    <div class="card-footer">
                        <{$page?$page->render():''}>
                    </div>
                    <!-- /.card-body -->
                </div>
            </div>
        </section>
        <!-- /.content -->
    </div>
    <!-- /.content-wrapper -->

    <{include file="public/copyright"}>


</div>
<!-- ./wrapper -->

<{include file="public/footer"}>
<!-- DataTables  & Plugins -->
<{include file="public/data_tables"}>
<script>
    jeDate("#time",{
        format: "YYYY-MM-DD",
        range:" 至 "
    });
</script>
<script>
    $(function () {

        $("#my_table").DataTable({
            "ordering": false,//禁用排序
            "responsive": true,
            "lengthChange": false,
            "autoWidth": false,
            "buttons": ["copy", "csv", "excel", "pdf", "print", "colvis"],
           // "pageLength": 10,         //初始化显示几条数据
            //serverSide: true, // use local process instead of server
           // bFilter: true, // show top right search input box.
            bPaginate: false,//是否开启分页
            //iDisplayLength: 10, //默认显示的记录数
            bInfo: false,//是否显示页脚信息，DataTables插件左下角显示记录数
        }).buttons().container().appendTo('#my_table_wrapper .col-md-6:eq(0)');

    });
</script>
</body>
</html>
